package com.itext.utils;
import java.io.IOException;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.pdf.BaseFont;

/**
 * 自定义字体
 * @author mbc
 * 2015/10/29
 */
public class CustomFont {
	//默认 宋体
	private static final String defaultFontPath = "/simsun.ttf";
	//段宁毛笔行书
	private static final String dnmbxsFontPath = "/dnmbxs.ttf";
	//李旭科书法
	private static final String lxksfFontPath = "/lxksf.ttf";
	//李旭科毛笔行书
	private static final String lxkmbxsFontPath = "/lxkmbxs.ttf";
	//华文新魏
	private static final String hwxwFontPath = "/hwxw.ttf";
	
	
	/**
	 * 获取默认字体
	 * @return 返回 BaseFont
	 * @throws DocumentException
	 * @throws IOException
	 */
	public static BaseFont getDefaultFont() throws DocumentException, IOException{
		return BaseFont.createFont(defaultFontPath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
	}
	
	/**
	 *  获取段宁毛笔行书
	 * @return 返回 BaseFont
	 * @throws DocumentException
	 * @throws IOException
	 */
	public static BaseFont getDnmbxsFont() throws DocumentException, IOException{
		return BaseFont.createFont(dnmbxsFontPath,BaseFont.IDENTITY_H,BaseFont.EMBEDDED);
	}
	
	/**
	 *  获取李旭科书法
	 * @return  BaseFont
	 * @throws DocumentException
	 * @throws IOException
	 */
	public static BaseFont getLxksfFont() throws DocumentException, IOException{
		return BaseFont.createFont(lxksfFontPath,BaseFont.IDENTITY_H,BaseFont.EMBEDDED);
	}
	
	/**
	 *  获取李旭科毛笔行书
	 * @return BaseFont
	 * @throws DocumentException
	 * @throws IOException
	 */
	public static BaseFont getLxkmbxsFont() throws DocumentException, IOException{
		return BaseFont.createFont(lxkmbxsFontPath,BaseFont.IDENTITY_H,BaseFont.EMBEDDED);
	}
	/**
	 *  获取华文新魏
	 * @return BaseFont
	 * @throws DocumentException
	 * @throws IOException
	 */
	public static BaseFont getHwxwFont() throws DocumentException, IOException{
		return BaseFont.createFont(hwxwFontPath,BaseFont.IDENTITY_H,BaseFont.EMBEDDED);
	}
	
	
}
